<?php

namespace app\backend\controller\sys;

use app\common\controller\Basic;
use app\common\service\sys\ConfigService;

/**
 * 系统配置
 * @author kaige
 * @copyright ©2022 泉州市盛筑信息科技有限公司 版权所有
 * @update 2022-06-08
 */
class Config extends Basic
{

  // 初始化
  protected function initialize()
  {
    parent::initialize();
    // 当前控制器服务实例化
    $this->service = new ConfigService();
  }

  /**
   * 列表
   * @return array|string
   */
  public function index()
  {
    if ($this->request->isGet()) {
      return _jok('ok',$this->service->getalldata());
    }
    if ($this->request->isPost()) {
      $data = $this->request->param();
      url_decode($data);
      return json($this->service->saveAllData($data));
    }
    return _jerr(1000);
  }

 
}
